package knowse.app.presentation;

import java.io.IOException;

import org.json.JSONObject;

import knowse.app.FetchData;
import knowse.app.R;
import knowse.app.TestDataObject;
import knowse.app.R.layout;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.os.Parcel;
import android.widget.TableLayout;
import android.widget.TextView;

public class TestCaseActivity extends Activity{
	
	
//	Declare textviews
	TextView fileName;
	TextView testClass;
	TextView method;
	TextView message;
	TextView type;
	TextView location;
	
	JSONObject object;
	
	@Override
	public void onCreate(Bundle savedInstanceState){
		super.onCreate(savedInstanceState);
		setContentView(R.layout.testcaseactivity);
		
		System.out.println("TestCaseActivity");
		
		//Binding the textviews to this activity
		fileName=(TextView) this.findViewById(R.id.fileName);
		testClass=(TextView) this.findViewById(R.id.testClass);
		method=(TextView) this.findViewById(R.id.method);
		message=(TextView) this.findViewById(R.id.message);
		type=(TextView) this.findViewById(R.id.type);
		location=(TextView) this.findViewById(R.id.location);
		
		//get the bundle from intent
		
		Intent intent=this.getIntent();
		
		//create the testDataObject
		TestDataObject testDataObject= (TestDataObject) getIntent().getParcelableExtra("jsonFile");
		String timeStamp=(String) getIntent().getStringExtra("TimeStamp");
			
		//display the element of the testDataObject
		fileName.setText("FileName: "+timeStamp);
		testClass.setText("TestClass: "+testDataObject.getTestClass());
		method.setText("Method: "+testDataObject.getMethod());
		message.setText("Message: "+testDataObject.getMessage());
		type.setText("Type: "+testDataObject.getType());
		location.setText("Location: "+testDataObject.getLocation());

		
		
		

		
	}
}
